﻿@model IEnumerable<DataSync.Models.ReportViewModel>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table-striped">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.ProjectCode)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Created)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Update)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Submitted)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @if (!string.IsNullOrEmpty(item.ProjectCode))
                {
                    @Html.ActionLink(item.ProjectCode, "Details", new { rId = item.Id }, null)
                }
                    
@*                           @Html.DisplayFor(modelItem => item.ProjectCode)*@
                @item.ProjectCode
            </td>
            <td>
                @item.Created
            </td>
            <td>
                @item.Update
            </td>
            <td>
                @item.Submitted
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
            </td>
        </tr>
    }

</table>
